package com.kakarote.ids.provider.entity.VO;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.kakarote.common.entity.SimpleUser;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel("部门VO")
public class IdsDeptVO {
	@ApiModelProperty("部门ID")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long deptId;
	@ApiModelProperty("部门名称")
	private String deptName;
	@ApiModelProperty("上级部门")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long parentId;
	@ApiModelProperty("备注")
	private String description;

	public void setDeptId(Long deptId) {
		this.deptId = deptId;
	}

	@ApiModelProperty("用户池ID")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long poolId;
	@ApiModelProperty("是否是主部门（0否 1是）")
	private Integer isMainDept;
	@ApiModelProperty("是否是负责人（0否 1是）")
	private Integer isLeader;
	@ApiModelProperty("下级部门列表")
	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private List<IdsDeptVO> children;
	@ApiModelProperty("部门下员工列表")
	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private List<SimpleUser> userList;

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public void setPoolId(Long poolId) {
		this.poolId = poolId;
	}

	public void setIsMainDept(Integer isMainDept) {
		this.isMainDept = isMainDept;
	}

	public void setIsLeader(Integer isLeader) {
		this.isLeader = isLeader;
	}

	public void setChildren(List<IdsDeptVO> children) {
		this.children = children;
	}

	public void setUserList(List<SimpleUser> userList) {
		this.userList = userList;
	}

	public boolean equals(Object o) {
		if (o == this)
			return true;
		if (!(o instanceof IdsDeptVO))
			return false;
		IdsDeptVO other = (IdsDeptVO) o;
		if (!other.canEqual(this))
			return false;
		Object this$deptId = getDeptId(), other$deptId = other.getDeptId();
		if ((this$deptId == null) ? (other$deptId != null) : !this$deptId.equals(other$deptId))
			return false;
		Object this$parentId = getParentId(), other$parentId = other.getParentId();
		if ((this$parentId == null) ? (other$parentId != null) : !this$parentId.equals(other$parentId))
			return false;
		Object this$poolId = getPoolId(), other$poolId = other.getPoolId();
		if ((this$poolId == null) ? (other$poolId != null) : !this$poolId.equals(other$poolId))
			return false;
		Object this$isMainDept = getIsMainDept(), other$isMainDept = other.getIsMainDept();
		if ((this$isMainDept == null) ? (other$isMainDept != null) : !this$isMainDept.equals(other$isMainDept))
			return false;
		Object this$isLeader = getIsLeader(), other$isLeader = other.getIsLeader();
		if ((this$isLeader == null) ? (other$isLeader != null) : !this$isLeader.equals(other$isLeader))
			return false;
		Object this$deptName = getDeptName(), other$deptName = other.getDeptName();
		if ((this$deptName == null) ? (other$deptName != null) : !this$deptName.equals(other$deptName))
			return false;
		Object this$description = getDescription(), other$description = other.getDescription();
		if ((this$description == null) ? (other$description != null) : !this$description.equals(other$description))
			return false;
		List<IdsDeptVO> this$children = (List<IdsDeptVO>) getChildren(),
				other$children = (List<IdsDeptVO>) other.getChildren();
		if ((this$children == null) ? (other$children != null) : !this$children.equals(other$children))
			return false;
		List<SimpleUser> this$userList = (List<SimpleUser>) getUserList(),
				other$userList = (List<SimpleUser>) other.getUserList();
		return !((this$userList == null) ? (other$userList != null) : !this$userList.equals(other$userList));
	}

	protected boolean canEqual(Object other) {
		return other instanceof IdsDeptVO;
	}

	public int hashCode() {
		int PRIME = 59;
		int result = 1;
		Object $deptId = getDeptId();
		result = result * 59 + (($deptId == null) ? 43 : $deptId.hashCode());
		Object $parentId = getParentId();
		result = result * 59 + (($parentId == null) ? 43 : $parentId.hashCode());
		Object $poolId = getPoolId();
		result = result * 59 + (($poolId == null) ? 43 : $poolId.hashCode());
		Object $isMainDept = getIsMainDept();
		result = result * 59 + (($isMainDept == null) ? 43 : $isMainDept.hashCode());
		Object $isLeader = getIsLeader();
		result = result * 59 + (($isLeader == null) ? 43 : $isLeader.hashCode());
		Object $deptName = getDeptName();
		result = result * 59 + (($deptName == null) ? 43 : $deptName.hashCode());
		Object $description = getDescription();
		result = result * 59 + (($description == null) ? 43 : $description.hashCode());
		List<IdsDeptVO> $children = (List<IdsDeptVO>) getChildren();
		result = result * 59 + (($children == null) ? 43 : $children.hashCode());
		List<SimpleUser> $userList = (List<SimpleUser>) getUserList();
		return result * 59 + (($userList == null) ? 43 : $userList.hashCode());
	}

	public String toString() {
		return "IdsDeptVO(deptId=" + getDeptId() + ", deptName=" + getDeptName() + ", parentId=" + getParentId()
				+ ", description=" + getDescription() + ", poolId=" + getPoolId() + ", isMainDept=" + getIsMainDept()
				+ ", isLeader=" + getIsLeader() + ", children=" + getChildren() + ", userList=" + getUserList() + ")";
	}

	public Long getDeptId() {
		return this.deptId;
	}

	public String getDeptName() {
		return this.deptName;
	}

	public Long getParentId() {
		return this.parentId;
	}

	public String getDescription() {
		return this.description;
	}

	public Long getPoolId() {
		return this.poolId;
	}

	public Integer getIsMainDept() {
		return this.isMainDept;
	}

	public Integer getIsLeader() {
		return this.isLeader;
	}

	public List<IdsDeptVO> getChildren() {
		return this.children;
	}

	public List<SimpleUser> getUserList() {
		return this.userList;
	}
}
